#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "
DROP TABLE if exists edu_online_dws.dws_visit_consult_data_count;
create table edu_online_dws.dws_visit_consult_data_count(
    --维度
    day            STRING COMMENT '天',
    month          STRING COMMENT '月',
    quarter        STRING COMMENT '季度',
    year           STRING COMMENT '年',
    country                      STRING COMMENT '所在国家',
    province                     STRING COMMENT '省',
    city                         STRING COMMENT '城市',
    origin_channel STRING COMMENT '投放渠道',
    seo_source     STRING COMMENT '搜索来源',
    from_url       STRING COMMENT '会话来源页面',
    group_type     STRING COMMENT '分组字段',
    --日统计
    visit_person      BIGINT COMMENT '访问人数',
    visit_dialogue    BIGINT COMMENT '会话数',
    visit_ip          BIGINT COMMENT 'IP数',
    country_consult_rate       decimal(34,4) COMMENT '国家咨询率',
    province_consult_rate       decimal(34,4) COMMENT '省咨询率',
    city_consult_rate       decimal(34,4) COMMENT '市咨询率'

)
COMMENT '销售主题日统计宽表'
row format delimited fields terminated by '\t'
stored as orc
tblproperties ('orc.compress' = 'ZLIB');
"